﻿import os
import os.path
import arcpy
rootdir = u"I:\\山洪灾害数据\\非涉密成果\\县级工作底图成果\\第二批工作底图（68个县）\\"
arcpy.env.workspace = rootdir
outLocation=u"C:\\Users\\lenovo\\Documents\\ArcGIS\\各县行政区.gdb"
filename="BOUA.shp"
for dirname in os.listdir(rootdir):
     if os.path.isdir(rootdir+dirname):
         inFeatures=dirname+"\\DLG\\"+filename
         outFeatureClass = "BOUA" +dirname
		 # Execute FeatureClassToFeatureClass
         arcpy.FeatureClassToFeatureClass_conversion(inFeatures, outLocation,outFeatureClass)
#content = raw_input("input:")